package ssh_UserManager;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.zjr.dao.UserDao;
import com.zjr.domain.User;


public class UserTest {
	@Test
	public void TestUserLogin(){
		ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
		UserDao udao = (UserDao) ac.getBean("userDao");
//		User user = new User();
//		user.setUsername("admin");
//		user.setPassword("admin");
//		
//		User exit = udao.login(user);
		System.out.println(udao.count());
	}
	
	@Test
	public void TestC3p0(){
		ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
		ComboPooledDataSource date = (ComboPooledDataSource)ac.getBean("dateSource");
		System.out.println(date);
	}
}
